home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / misc / Hunk.lha / Hunk / Hoppers / General.hop < prev    next >
Text File  |  1998-02-14  |  3KB  |  141 lines

  1. ;*************************************************************************
  2. ;** General Optimizer PC Absolute to Relative                           **
  3. ;** Contributor: Thomas Richter (thor)                  Nov  1st  1997  **
  4. ;** Modify all absolute addressing to PC relative if possible           **
  5. ;*************************************************************************
  6.  
  7.  
  8.  
  9. ;*************************************************************************
  10. ;
  11. ; MOVE.L
  12. ;
  13. #match
  14. #code
  15. %0010XXXXXX111001  =# SourceEA          ;MOVE.L ABS,rx
  16. RRRR RRRR          =@ EA
  17. ;
  18. ;
  19. #replace
  20. %0010XXXXXX111010  =# SourceEA          ;MOVE.L d(PC),rx
  21. YYYY               =@ EA
  22. 4E71
  23. #end
  24.  
  25.  
  26. ;*************************************************************************
  27. ;
  28. ; MOVE.W
  29. ;
  30. #match
  31. #code
  32. %0011XXXXXX111001  =# SourceEA          ;MOVE.W ABS,rx
  33. RRRR RRRR          =@ EA
  34. ;
  35. ;
  36. #replace
  37. %0011XXXXXX111010  =# SourceEA          ;MOVE.W d(PC),rx
  38. YYYY               =@ EA
  39. 4E71
  40. #end
  41.  
  42.  
  43. ;*************************************************************************
  44. ;
  45. ; MOVE.B
  46. ;
  47. #match
  48. #code
  49. %0001XXXXXX111001  =# SourceEA          ;MOVE.L ABS,rx
  50. RRRR RRRR          =@ EA
  51. ;
  52. ;
  53. #replace
  54. %0001XXXXXX111010  =# SourceEA          ;MOVE.L d(PC),rx
  55. YYYY               =@ EA
  56. 4E71
  57. #end
  58.  
  59.  
  60. ;*************************************************************************
  61. ;
  62. ; MOVE.L #???,Ax        ->      LEA
  63. ;
  64. #match
  65. #code
  66. %0010XXX001111100  =# SourceEA          ;MOVE.L #ABS,Ax
  67. RRRR RRRR          =@ EA
  68. ;
  69. ;
  70. #replace
  71. %0100XXX111111010  =# SourceEA          ;LEA d(PC),Ax
  72. YYYY               =@ EA
  73. 4E71
  74. #end
  75.  
  76. ;*************************************************************************
  77. ;
  78. ; JMP Abs
  79. ;
  80. #match
  81. #code
  82. 4EF9                                    ; JMP Abs.L
  83. RRRR RRRR         =@ EA
  84. ;
  85. ;
  86. #replace
  87. 4EFA                                    ; JMP d(PC)
  88. YYYY              =@ EA
  89. 4E71
  90. #end
  91.  
  92. ;*************************************************************************
  93. ;
  94. ; JSR Abs
  95. ;
  96. #match
  97. #code
  98. 4EB9                                    ; JSR Abs.L
  99. RRRR RRRR         =@ EA
  100. ;
  101. ;
  102. #replace
  103. 4EBA                                    ; JSR d(PC)
  104. YYYY              =@ EA
  105. 4E71
  106. #end
  107.  
  108. ;*************************************************************************
  109. ;
  110. ; PEA Abs
  111. ;
  112. #match
  113. #code
  114. 4879                                    ; PEA Abs.L
  115. RRRR RRRR         =@ EA
  116. ;
  117. ;
  118. #replace
  119. 487A                                    ; PEA d(PC)
  120. YYYY              =@ EA
  121. 4E71
  122. #end
  123.  
  124. ;*************************************************************************
  125. ;
  126. ; LEA Abs
  127. ;
  128. #match
  129. #code
  130. %0100XXX111111001 =# SourceEA           ; LEA Abs.l,Ax
  131. RRRR RRRR         =@ EA
  132. ;
  133. ;
  134. #replace
  135. %0100XXX111111010 =# SourceEA           ; LEA d(PC),Ax
  136. YYYY              =@ EA
  137. 4E71
  138. #end
  139.  
  140.  
  141.